<?php $this->_extends('_layouts/default_layout'); ?>
 
<?php $this->_block('contents'); ?>

<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/setting/style.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/setting/main.css">

<a href="<?php echo url('systemsetting/DatabaseManagement'); ?>">数据库状态</a>

<br />
<br />

<div>
 <h3>提示信息</h3>
<div class="text">
	<div class="s3" style="margin-left:1em;">
<li>这里显示数据库的状态信息。</li>
	</div>
</div>
<!--内容部分结束-->
</td><td class="box-main-right"></td></tr>
<tr><td class="box-bottom-left"></td><td class="box-bottom-cen"></td><td class="box-bottom-right"></td></tr>
</table>
<!--提示信息-->

<!-- item 1-->
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td class="box-top-left"></td><td class="box-top-cen"></td><td class="box-top-right"></td></tr>
<tr><td class="box-main-left"></td>
<td>
<h3>数据库表</h3>
<div class="text">
		<form action="<?php echo url('systemsetting/dbbackup'); ?>" method="post" id="mainform">
		<table cellpadding="0" cellspacing="0" width="100%">
			<tbody class="">
			<tr class="tth">
				<td width="40%">数据库表名</td>
				<td width="20%">记录数</td>
				<td width="30%">数据大小</td>
				<td width="10%">操作</td>
			</tr>
            <?php foreach ($tianyi_tables as $table):?>
				<tr>
				<td><?php echo $table['0'] ?></td>
				<td><?php echo $table['1'] ?></td>
				<td><?php echo $table['2'] ?></td>
                <td><input type="checkbox" name="checkbox_name[]" value="<?php echo $table['0'] ?>" /></td>
			</tr>
            <?php endforeach; ?>	
			<tr>
				<td class="tbutton" colspan="4"><input class="hidden" name="ispost" type="hidden" value="on"><input type="button" value="全选" onclick="PBchoseAll(this.form)" class="btn" />&nbsp;&nbsp;<input type="submit" onclick="return(checkfirst(this.form))" value="备份" class="btn" name="submit"></td>
			</tr>
			</tbody>
		</table>
</div>


<br />
<!-- item 3-->
<!-- item end-->
</div>


<script>
var ifcheck = true;
function PBchoseAll(form)
{
	for(var i = 0; i < form.elements.length; i ++)
	{
		var e = form.elements[i];
		if (e.type == 'checkbox')
		{
			e.checked = ifcheck;
		}
	}
	ifcheck = (ifcheck == true) ? false : true;
}
function checkfirst(form)
{

	for(var i = 0; i < form.elements.length; i ++)
	{
		var e = form.elements[i];
		if (e.type == 'checkbox' && e.checked)
		{
			return true;
		}
	}
    alert("请选择需要备份的表");
    return false;
}
</script>

<?php $this->_endblock(); ?>